library(tidyverse)
library(readxl)
path = "Excel/690 Alphabets Grid Sum.xlsx"
input = read_excel(path, range = "A2:J12", col_names = FALSE) %>% as.matrix()
test = read_excel(path, range = "L1:M23")
M = input %>%
t() %>%
matrix(ncol = 2, byrow = TRUE) %>%
as.data.frame() %>%
mutate(V2 = as.numeric(V2)) %>%
summarise(V2 = sum(V2), .by = V1) %>%
arrange(V1) %>%
select(Alphabets = V1, Sum = V2)
all.equal(M, test, check.attributes = FALSE)
# [1] TRUEExcel BI - Excel Challenge 690
excel-challenges
excel-formulas
🔰 Find the sum of values against all alphabets.

Challenge Description
🔰 Find the sum of values against all alphabets.
Solutions
- Logic: Read the workbook ranges needed for the challenge; Derive the required intermediate columns; Aggregate or rank the data at the required grouping level.
- Strengths: The code maps the workbook rule into a compact, reproducible pipeline.
- Areas for Improvement: The solution assumes the workbook layout and selected ranges remain stable, so any structural change in the sheet would require small adjustments.
- Gem: The elegant part is how little code is needed once the correct intermediate representation is chosen.
import pandas as pd
import numpy as np
path = "690 Alphabets Grid Sum.xlsx"
input = pd.read_excel(path, usecols="A:J", nrows = 11, skiprows = 1, header=None).to_numpy()
test = pd.read_excel(path, usecols="L:M", nrows = 23)
result = pd.DataFrame(input.reshape((-1, 2)), columns=["Alphabets", "Sum"])
result["Sum"] = pd.to_numeric(result["Sum"], errors="coerce")
summary = result.groupby("Alphabets", as_index=False)["Sum"].sum()
summary = summary.sort_values("Alphabets")
print(summary.equals(test)) # TrueThe Python version follows the same grouped logic and keeps the transformation explicit in a dataframe pipeline.
Difficulty Level
Easy / Medium
The business rule is clear, though the workbook still needs a few transformation steps to reach the expected output.